cc.Class({
    extends: cc.Component,

    properties: {

    },
    ctor: function() {
        this.canUpdateMove = false;
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad() {

    },
    //刷新子弹移动的位置
    update(dt) {
        if (this.canUpdateMove) {
            this.node.y += dt * 1000;
            if (this.node.y > 500) {
                gameCtrl.onKillBullet(this.node);
            }
        }

    },
    onCollisionEnter: function(other, self) {
        // console.log('on collision stay',other.node);
        if (other.tag === 0) { //0是病毒
            gameCtrl.onKillBullet(this.node);
        }


    },
    init() {
        this.canUpdateMove = false;
    },
    setsecondPos(pos) {
        let seq = cc.sequence(cc.moveTo(0.5, cc.v2(pos.x, pos.y)), cc.callFunc(function() {
            this.canUpdateMove = true;
        }.bind(this)));
        this.node.runAction(seq);
    },


    //Methods

});